﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hotnet.Dal.NSDalVideo;
using Hotnet.Entity;
using Ninject.Core;
using Hotnet.Entity.Enum;
using Hotnet.Biz.NSBizCommon;

namespace Hotnet.Biz.NSBizVideo
{
	public class BizVideoXTag:BaseBiz<VideoXTag>
	{
		private static DalVideoXTag db=new DalVideoXTag();
		private static BizTag bizTag = new BizTag();

		public BizVideoXTag()
			: base(db)
		{

		}
		public void Insert(List<VideoXTag> models)
		{
			db.Insert(models);
		}

		public VideoXTag[] ListVideoXTags(int id)
		{
			return db.ListVideoXTags(id);
		}

		/// <summary>
		/// 返回tag 列表
		/// </summary>
		/// <param name="id"></param>
		/// <param name="type"></param>
		/// <returns></returns>
		public Tag[] ListVideoTags(int id)
		{
			return db.ListVideoTags(id);
		}

		public string ListVideoTagsByString(int id)
		{
			VideoXTag[] list=ListVideoXTags(id);
			StringBuilder sb = new StringBuilder();
			foreach (var item in list)
			{
				sb.Append(bizTag.Get(item.TagID).TagName+" ");
			}
			return sb.ToString();
		}

		public void Delete(int videoOrVideoGroupID)
		{
			db.Delete(videoOrVideoGroupID);
		}
		
	

	}
}
